Search the reference...
/
method
Calls endpoint.close() and returns a promise that fulfills when the endpoint has closed.
endpoint.close()